from django.urls import path
from .views import (
    GenerateLogistExamAPIView, QuestionListAPIView, QuestionDetailAPIView,
    LogistQuestionViewSet, ExamSessionAPIView, ExamAnswerAPIView
)

urlpatterns = [
    path('exam/', GenerateLogistExamAPIView.as_view(), name='generate-exam'),
    path('questions/', QuestionListAPIView.as_view(), name='question-list'),
    path('questions/<int:pk>/', QuestionDetailAPIView.as_view(), name='question-detail'),
    
    # 考试会话相关的URL
    path('sessions/', ExamSessionAPIView.as_view(), name='create-session'),
    path('sessions/<str:session_id>/', ExamSessionAPIView.as_view(), name='session-detail'),
    path('sessions/<str:session_id>/answer/', ExamAnswerAPIView.as_view(), name='submit-answer'),
    path('sessions/<str:session_id>/complete/', ExamAnswerAPIView.as_view(), {'action': 'complete'}, name='complete-exam'),
]